<?php if($login==1){?>

<link type="text/css" href="<?php echo BASE_URL?>ext/js/menu/menu.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo BASE_URL?>ext/js/menu/menu.js"></script>
<style>
div#menu{position:absolute;top:-2px;left:0px;width:100%}
div#menu ul.menu{width:100%;padding-left:0px}
div#menu ul li{text-align:left}
div#menu ul li#clock{float:right;}
</style>

<?php
switch($page)
{
	case 'homepage':
	case 'image':
	case 'project':
		if($action=='')
			$items=array("?page=$page&action=edit"=>'&#8226; Edit');
		else if($action=='edit')
			$items=array("?page=$page"=>'&#8226; Close',);
		break;
	case 'profile':
	case 'contact':
	case 'architecture-design':
	case 'construction':
	case 'news':
		if($action=='')
			$items=array("?page=$page&action=edit"=>'&#8226; Edit');
		else if($action=='edit')
			$items=array("?page=$page"=>'&#8226; Close',);
		break;
	case 'change-password':
		$items=array("index.php"=>'&#8226; Close',);
		break;
	case 'login':
		$items=null;
	default:
		$items=array();
		break;
}
if($items!=null)
{
	$items=$items+array("?page=language&language=vn"=>'&#8226; Vietnamese',"?page=language&language=en"=>'&#8226; English',"?page=logout"=>'&#8226; Logout');
	if($page!='change-password')
		$items=$items+array("?page=change-password"=>'&#8226; Change password');		
}

?>

<div id="menu">
	<ul class="menu">
		<li id='clock' >
			<a href="#" >
				<span>
					<object type="application/x-shockwave-flash" data="ext/flash/flip_clock_black_12.swf" width="70" height="30">
					<param name="movie" value="ext/flash/flip_clock_black_12.swf">
					<param name="WMode" value="Transparent">
					</object>
				</span>
			</a>
		</li>
		<li>
			<a href="index.php" class="parent"><span><b>IADE</b><b style='position:relative;top:-5px;margin-left:3px'>&reg;</b></span></a>
			<ul>
			<?php foreach($pages as $key=>$value){?>
				<li>
					<a <?php echo $key=='news'?" class='parent' ":""?> href="?page=<?php echo $key;?>&action=edit"><span><?php echo ucfirst($key);?></span></a>
					<?php if($key=='news'){?>
					<ul>
						<li><a href="?page=architecture-design&action=edit"><span><?php echo LARCHITECTURE_DESIGN?></span></a></li>
						<li><a href="?page=construction&action=edit"><span><?php echo LCONSTRUCTION?></span></a></li>
					</ul>
					<?php }?>
				</li>
			<?php }?>
			</ul>
		</li>
		<?php foreach($items as $link=>$label){?>
		<li>
			<a href='<?php echo $link;?>'><span><?php echo $label;?></span></a>
		</li>
		<?php }?>
	</ul>
</div>

<div style='display:none'><div id="copyright">Copyright &copy; 2011 <a href="http://apycom.com/">Apycom jQuery Menus</a></div></div>

<?php }else{if(isset($_GET['action']) || $page=='change-password'){Common::header_location('?page=login');}}?>
